package com.tsmask.bound;

import java.awt.Color;
import java.awt.Font;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 * 最近天气组件
 * 
 * @author TsMask
 *
 */
public class ForeastBound {

	/**
	 * 天气日期组件
	 * 
	 * @return 标签组件
	 */
	public JLabel date(String data, int x) {
		JLabel jLabel = new JLabel(data, JLabel.CENTER);
		jLabel.setBounds(x, 300, 150, 30);
		jLabel.setForeground(Color.LIGHT_GRAY);
		jLabel.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 14));
		return jLabel;
	}

	/**
	 * 天气类型图片组件
	 * 
	 * @return 标签组件
	 */
	public JLabel picture(String state, int x) {
		JLabel jLabel = new JLabel();
		jLabel.setBounds(x, 350, 150, 56);
		jLabel.setHorizontalAlignment(JLabel.CENTER);
		ImageIcon image = new ImageIcon("resource\\wether\\" + state + ".png");
		image.setImage(image.getImage().getScaledInstance(56, 56, Image.SCALE_DEFAULT));
		jLabel.setIcon(image);
		return jLabel;
	}

	/**
	 * 天气类型组件
	 * 
	 * @return 标签组件
	 */
	public JLabel type(String type, int x) {
		JLabel jLabel = new JLabel(type);
		jLabel.setBounds(x, 412, 150, 30);
		jLabel.setHorizontalAlignment(JLabel.CENTER);
		jLabel.setForeground(Color.WHITE);
		jLabel.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));
		return jLabel;
	}

	/**
	 * 天气温度组件
	 * 
	 * @return 标签组件
	 */
	public JLabel humidity(String value, int x) {
		JLabel jLabel = new JLabel(value);
		jLabel.setBounds(x, 436, 75, 30);
		jLabel.setHorizontalAlignment(JLabel.RIGHT);
		jLabel.setForeground(Color.WHITE);
		jLabel.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));
		return jLabel;
	}

	/**
	 * 天气风级组件
	 * 
	 * @return 标签组件
	 */
	public JLabel winddir(String value, int x) {
		JLabel jLabel = new JLabel(value);
		jLabel.setBounds(96 + x, 436, 75, 30);
		jLabel.setHorizontalAlignment(JLabel.LEFT);
		jLabel.setForeground(Color.WHITE);
		jLabel.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 14));
		return jLabel;
	}
}
